﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

#region Usings

using System;
using ScrumTable.Config.UserManagement;
using ScrumTable.UI.ViewModel.Controller;
using Microsoft.Practices.Unity;
using ScrumTable.UI.ViewModel.Data;

#endregion

namespace ScrumTable.UI.ViewModel.Tag
{
    /// <summary>
    /// Description of the class
    /// </summary>
    public class LoginTagViewModel : ViewModelBase
    {

        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------
        private string _error;

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------


        /// <summary>
        /// Gets or sets the error info.
        /// </summary>
        /// <value>The error info.</value>
        public string ErrorConnect
        {
            get
            {
                return _error;
            }
            set
            {
                _error = value;
                SendPropertyChanged("ErrorConnect");
            }
        }

        /// <summary>
        /// Gets or sets the login account manager.
        /// </summary>
        /// <value>The login account manager.</value>
        [Dependency]
        public LoginAccountManager LoginAccountManager { get; set;}

        /// <summary>
        /// Gets or sets the scrum data.
        /// </summary>
        /// <value>The scrum data.</value>
        [Dependency]
        public ScrumViewModelData ScrumData { get; set; }
        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        #endregion

        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        /// <summary>
        /// Validates the password.
        /// </summary>
        /// <param name="password">The password.</param>
        public void ValidatePassword(String password)
        {
            ScrumData.Connect(password, NavigationTarget.Null, true, e => ErrorConnect = e);                      
        }
        #endregion
        
        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------

      
        #endregion

    }
}